{% extends "base.html" %}

{% block title %}仪表板 - 管理系统{% endblock %}

{% block content %}
<div class="row">
    <div class="col-12">
        <h2 class="mb-4">仪表板</h2>
        <div class="card">
            <div class="card-body">
                <h5 class="card-title">欢迎回来，{{ current_user.username }}!</h5>
                <p class="card-text">您的角色是: 
                    {% for role in current_user.roles %}
                        {{ role.name }}{% if not loop.last %}, {% endif %}
                    {% endfor %}
                </p>
                
                {% if current_user.has_permission('manage_users') %}
                <div class="mb-3">
                    <a href="{{ url_for('admin.users') }}" class="btn btn-primary">管理用户</a>
                </div>
                {% endif %}
                
                {% if current_user.has_permission('manage_roles') %}
                <div class="mb-3">
                    <a href="{{ url_for('admin.roles') }}" class="btn btn-primary">管理角色</a>
                </div>
                {% endif %}
                
                {% if current_user.has_permission('manage_permissions') %}
                <div class="mb-3">
                    <a href="{{ url_for('admin.permissions') }}" class="btn btn-primary">管理权限</a>
                </div>
                {% endif %}
            </div>
        </div>
    </div>
</div>
{% endblock %} 